home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1998-08-17 | 29.2 KB | 1,043 lines | [ TEXT/MPS ]
; ; File: InputSprocket.a ; ; Contains: Games Sprockets: InputSprocket interfaaces ; ; Version: Technology: Input Sprocket 1.3 ; Release: Universal Interfaces 3.2 ; ; Copyright: © 1996-1998 by Apple Computer, Inc., all rights reserved. ; ; Bugs?: For bug reports, consult the following page on ; the World Wide Web: ; ; http://developer.apple.com/bugreporter/ ; ; IF &TYPE('__INPUTSPROCKET__') = 'UNDEFINED' THEN __INPUTSPROCKET__ SET 1 IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN include 'MacTypes.a' ENDIF IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN include 'Events.a' ENDIF IF &TYPE('USE_OLD_INPUT_SPROCKET_LABELS') = 'UNDEFINED' THEN USE_OLD_INPUT_SPROCKET_LABELS: SET 0 ENDIF IF &TYPE('USE_OLD_ISPNEED_STRUCT') = 'UNDEFINED' THEN USE_OLD_ISPNEED_STRUCT: SET 0 ENDIF ; ********************* data types ********************* ; ISpDeviceClass is a general classs of device, example: keyboard, mouse, joystick ; typedef OSType ISpDeviceClass ; ISpDeviceIdentifier is a specific device, example: standard 1-button mouse, 105key ext. kbd. ; typedef OSType ISpDeviceIdentifier ; typedef OSType ISpElementLabel ; typedef OSType ISpElementKind ; *************** errors -30420 to -30439***************** kISpInternalErr EQU -30420 kISpSystemListErr EQU -30421 kISpBufferToSmallErr EQU -30422 kISpElementInListErr EQU -30423 kISpElementNotInListErr EQU -30424 kISpSystemInactiveErr EQU -30425 kISpDeviceInactiveErr EQU -30426 kISpSystemActiveErr EQU -30427 kISpDeviceActiveErr EQU -30428 kISpListBusyErr EQU -30429 ; *************** resources **************** kISpApplicationResourceType EQU 'isap' kISpSetListResourceType EQU 'setl' kISpSetDataResourceType EQU 'setd' ISpApplicationResourceStruct RECORD 0 flags ds.l 1 ; offset: $0 (0) reserved1 ds.l 1 ; offset: $4 (4) reserved2 ds.l 1 ; offset: $8 (8) reserved3 ds.l 1 ; offset: $C (12) sizeof EQU * ; size: $10 (16) ENDR kISpAppResFlag_UsesInputSprocket EQU $00000001 ; true if the application uses InputSprocket kISpAppResFlag_UsesISpInit EQU $00000002 ; true if the calls ISpInit (ie, uses the high level interface, calls ISpConfigure, has a needs list, etc...) ; ; * ISpDeviceDefinition ; * ; * This structure provides all the available ; * information for an input device within the system ; * ; ISpDeviceDefinition RECORD 0 deviceName ds Str63 ; offset: $0 (0) ; a human readable name of the device theDeviceClass ds.l 1 ; offset: $40 (64) ; general classs of device example : keyboard, mouse, joystick theDeviceIdentifier ds.l 1 ; offset: $44 (68) ; every distinguishable device should have an OSType permanentID ds.l 1 ; offset: $48 (72) ; a cross reboot id unique within that deviceType, 0 if not possible flags ds.l 1 ; offset: $4C (76) ; status flags reserved1 ds.l 1 ; offset: $50 (80) reserved2 ds.l 1 ; offset: $54 (84) reserved3 ds.l 1 ; offset: $58 (88) sizeof EQU * ; size: $5C (92) ENDR kISpDeviceFlag_HandleOwnEmulation EQU 1 ; ; * ISpElementEvent, ISpElementEventPtr ; * ; * This is the structure that event data is passed in. ; * ; ISpElementEvent RECORD 0 when ds AbsoluteTime ; offset: $0 (0) ; this is absolute time on PCI or later, otherwise it is ; 0 for the hi 32 bits and TickCount for the low 32 bits element ds.l 1 ; offset: $8 (8) ; a reference to the element that generated this event refCon ds.l 1 ; offset: $C (12) ; for application usage, 0 on the global list data ds.l 1 ; offset: $10 (16) ; the data for this event sizeof EQU * ; size: $14 (20) ENDR ; typedef struct ISpElementEvent * ISpElementEventPtr ; ; * ISpElementInfo, ISpElementInfoPtr ; * ; * This is the generic definition of an element. ; * Every element must contain this information. ; * ; ISpElementInfo RECORD 0 theLabel ds.l 1 ; offset: $0 (0) theKind ds.l 1 ; offset: $4 (4) theString ds Str63 ; offset: $8 (8) reserved1 ds.l 1 ; offset: $48 (72) reserved2 ds.l 1 ; offset: $4C (76) sizeof EQU * ; size: $50 (80) ENDR ; typedef struct ISpElementInfo * ISpElementInfoPtr ; typedef UInt32 ISpNeedFlagBits IF USE_OLD_ISPNEED_STRUCT THEN ISpNeed RECORD 0 name ds Str63 ; offset: $0 (0) iconSuiteResourceId ds.w 1 ; offset: $40 (64) ; resource id of the icon suite reserved ds.w 1 ; offset: $42 (66) theKind ds.l 1 ; offset: $44 (68) theLabel ds.l 1 ; offset: $48 (72) flags ds.l 1 ; offset: $4C (76) reserved1 ds.l 1 ; offset: $50 (80) reserved2 ds.l 1 ; offset: $54 (84) reserved3 ds.l 1 ; offset: $58 (88) sizeof EQU * ; size: $5C (92) ENDR ELSE ISpNeed RECORD 0 name ds Str63 ; offset: $0 (0) ; human-readable string iconSuiteResourceId ds.w 1 ; offset: $40 (64) ; resource id of the icon suite playerNum ds.b 1 ; offset: $42 (66) ; used for multi-player support group ds.b 1 ; offset: $43 (67) ; used to group related needs (eg, look left and look right button needs) theKind ds.l 1 ; offset: $44 (68) theLabel ds.l 1 ; offset: $48 (72) flags ds.l 1 ; offset: $4C (76) reserved1 ds.l 1 ; offset: $50 (80) reserved2 ds.l 1 ; offset: $54 (84) reserved3 ds.l 1 ; offset: $58 (88) sizeof EQU * ; size: $5C (92) ENDR ENDIF ; USE_OLD_ISPNEED_STRUCT kISpNeedFlag_NoMultiConfig EQU $00000001 ; once this need is autoconfigured to one device dont autoconfigure to anything else kISpNeedFlag_Utility EQU $00000002 ; this need is a utility function (like show framerate) which would not typically be assigned to anything but the keyboard kISpNeedFlag_PolledOnly EQU $00000004 kISpNeedFlag_EventsOnly EQU $00000008 ; *** kISpElementKind specific flags *** ; these are flags specific to kISpElementKind_Button kISpNeedFlag_Button_AlreadyAxis EQU $10000000 ; there is a axis version of this button need kISpNeedFlag_Button_ClickToggles EQU $20000000 kISpNeedFlag_Button_ActiveWhenDown EQU $40000000 kISpNeedFlag_Button_AlreadyDelta EQU $80000000 ; there is a delta version of this button need ; these are flags specific to kISpElementKind_DPad ; these are flags specific to kISpElementKind_Axis kISpNeedFlag_Axis_AlreadyButton EQU $10000000 ; there is a button version of this axis need kISpNeedFlag_Axis_Asymetric EQU $20000000 ; this axis need is asymetric kISpNeedFlag_Axis_AlreadyDelta EQU $40000000 ; there is a delta version of this axis need ; these are flags specific to kISpElementKind_Delta kISpNeedFlag_Delta_AlreadyAxis EQU $10000000 ; there is a axis version of this delta need kISpNeedFlag_Delta_AlreadyButton EQU $20000000 ; there is a button version of this delta need ; ; * ; * These are the current built values for ISpDeviceClass ; * ; kISpDeviceClass_SpeechRecognition EQU 'talk' kISpDeviceClass_Mouse EQU 'mous' kISpDeviceClass_Keyboard EQU 'keyd' kISpDeviceClass_Joystick EQU 'joys' kISpDeviceClass_Wheel EQU 'whel' kISpDeviceClass_Pedals EQU 'pedl' kISpDeviceClass_Levers EQU 'levr' kISpDeviceClass_Tickle EQU 'tckl' ; a device of this class requires ISpTickle kISpDeviceClass_Unknown EQU '????' ; ; * These are the current built in ISpElementKind's ; * ; * These are all OSTypes. ; * ; kISpElementKind_Button EQU 'butn' kISpElementKind_DPad EQU 'dpad' kISpElementKind_Axis EQU 'axis' kISpElementKind_Delta EQU 'dlta' kISpElementKind_Movement EQU 'move' kISpElementKind_Virtual EQU 'virt' ; ; * ; * These are the current built in ISpElementLabel's ; * ; * These are all OSTypes. ; * ; IF USE_OLD_INPUT_SPROCKET_LABELS THEN ; axis kISpElementLabel_XAxis EQU 'xaxi' kISpElementLabel_YAxis EQU 'yaxi' kISpElementLabel_ZAxis EQU 'zaxi' kISpElementLabel_Rx EQU 'rxax' kISpElementLabel_Ry EQU 'ryax' kISpElementLabel_Rz EQU 'rzax' kISpElementLabel_Gas EQU 'gasp' kISpElementLabel_Brake EQU 'brak' kISpElementLabel_Clutch EQU 'cltc' kISpElementLabel_Throttle EQU 'thrt' kISpElementLabel_Trim EQU 'trim' ; direction pad kISpElementLabel_POVHat EQU 'povh' kISpElementLabel_PadMove EQU 'move' ; buttons kISpElementLabel_Fire EQU 'fire' kISpElementLabel_Start EQU 'strt' kISpElementLabel_Select EQU 'optn' ENDIF ; USE_OLD_INPUT_SPROCKET_LABELS ; generic kISpElementLabel_None EQU 'none' ; axis kISpElementLabel_Axis_XAxis EQU 'xaxi' kISpElementLabel_Axis_YAxis EQU 'yaxi' kISpElementLabel_Axis_ZAxis EQU 'zaxi' kISpElementLabel_Axis_Rx EQU 'rxax' kISpElementLabel_Axis_Ry EQU 'ryax' kISpElementLabel_Axis_Rz EQU 'rzax' kISpElementLabel_Axis_Roll EQU 'rzax' kISpElementLabel_Axis_Pitch EQU 'rxax' kISpElementLabel_Axis_Yaw EQU 'ryax' kISpElementLabel_Axis_RollTrim EQU 'rxtm' kISpElementLabel_Axis_PitchTrim EQU 'trim' kISpElementLabel_Axis_YawTrim EQU 'rytm' kISpElementLabel_Axis_Gas EQU 'gasp' kISpElementLabel_Axis_Brake EQU 'brak' kISpElementLabel_Axis_Clutch EQU 'cltc' kISpElementLabel_Axis_Throttle EQU 'thrt' kISpElementLabel_Axis_Trim EQU 'trim' kISpElementLabel_Axis_Rudder EQU 'rudd' ; delta kISpElementLabel_Delta_X EQU 'xdlt' kISpElementLabel_Delta_Y EQU 'ydlt' kISpElementLabel_Delta_Z EQU 'zdlt' kISpElementLabel_Delta_Rx EQU 'rxdl' kISpElementLabel_Delta_Ry EQU 'rydl' kISpElementLabel_Delta_Rz EQU 'rzdl' kISpElementLabel_Delta_Roll EQU 'rzdl' kISpElementLabel_Delta_Pitch EQU 'rxdl' kISpElementLabel_Delta_Yaw EQU 'rydl' ; direction pad kISpElementLabel_Pad_POV EQU 'povh' ; up/down/left/right kISpElementLabel_Pad_Move EQU 'move' ; up/down/left/right kISpElementLabel_Pad_POV_Horiz EQU 'hpov' ; forward/back/left/right kISpElementLabel_Pad_Move_Horiz EQU 'hmov' ; forward/back/left/right ; buttons kISpElementLabel_Btn_Fire EQU 'fire' kISpElementLabel_Btn_SecondaryFire EQU 'sfir' kISpElementLabel_Btn_Jump EQU 'jump' kISpElementLabel_Btn_PauseResume EQU 'strt' ; kISpElementLabel_Btn_PauseResume automatically binds to escape kISpElementLabel_Btn_Select EQU 'optn' kISpElementLabel_Btn_SlideLeft EQU 'blft' kISpElementLabel_Btn_SlideRight EQU 'brgt' kISpElementLabel_Btn_MoveForward EQU 'btmf' kISpElementLabel_Btn_MoveBackward EQU 'btmb' kISpElementLabel_Btn_TurnLeft EQU 'bttl' kISpElementLabel_Btn_TurnRight EQU 'bttr' kISpElementLabel_Btn_LookLeft EQU 'btll' kISpElementLabel_Btn_LookRight EQU 'btlr' kISpElementLabel_Btn_LookUp EQU 'btlu' kISpElementLabel_Btn_LookDown EQU 'btld' kISpElementLabel_Btn_Next EQU 'btnx' kISpElementLabel_Btn_Previous EQU 'btpv' kISpElementLabel_Btn_SideStep EQU 'side' kISpElementLabel_Btn_Run EQU 'quik' kISpElementLabel_Btn_Look EQU 'blok' ; ; * ; * direction pad data & configuration information ; * ; ; typedef UInt32 ISpDPadData kISpPadIdle EQU 0 kISpPadLeft EQU 1 kISpPadUpLeft EQU 2 kISpPadUp EQU 3 kISpPadUpRight EQU 4 kISpPadRight EQU 5 kISpPadDownRight EQU 6 kISpPadDown EQU 7 kISpPadDownLeft EQU 8 ISpDPadConfigurationInfo RECORD 0 id ds.l 1 ; offset: $0 (0) ; ordering 1..n, 0 = no relavent ordering of direction pads fourWayPad ds.b 1 ; offset: $4 (4) ; true if this pad can only produce idle + four directions ORG 6 sizeof EQU * ; size: $6 (6) ENDR ; ; * ; * button data & configuration information ; * ; ; typedef UInt32 ISpButtonData kISpButtonUp EQU 0 kISpButtonDown EQU 1 ISpButtonConfigurationInfo RECORD 0 id ds.l 1 ; offset: $0 (0) ; ordering 1..n, 0 = no relavent ordering of buttons sizeof EQU * ; size: $4 (4) ENDR ; ; * ; * axis data & configuration information ; * ; ; typedef UInt32 ISpAxisData ISpAxisConfigurationInfo RECORD 0 symetricAxis ds.b 1 ; offset: $0 (0) ; axis is symetric, i.e. a joystick is symetric and a gas pedal is not ORG 2 sizeof EQU * ; size: $2 (2) ENDR ; typedef Fixed ISpDeltaData ISpDeltaConfigurationInfo RECORD 0 reserved1 ds.l 1 ; offset: $0 (0) reserved2 ds.l 1 ; offset: $4 (4) sizeof EQU * ; size: $8 (8) ENDR ISpMovementData RECORD 0 xAxis ds.l 1 ; offset: $0 (0) yAxis ds.l 1 ; offset: $4 (4) direction ds.l 1 ; offset: $8 (8) ; ISpDPadData version of the movement sizeof EQU * ; size: $C (12) ENDR ISpMovementConfigurationInfo RECORD 0 reserved1 ds.l 1 ; offset: $0 (0) reserved2 ds.l 1 ; offset: $4 (4) sizeof EQU * ; size: $8 (8) ENDR kISpVirtualElementFlag_UseTempMem EQU 1 kISpElementListFlag_UseTempMem EQU 1 kISpFirstIconSuite EQU 30000 kISpLastIconSuite EQU 30100 kISpNoneIconSuite EQU 30000 IF TARGET_RT_MAC_CFM THEN ; ********************* user level functions ********************* ; ; * ; * startup / shutdown ; * ; ; ; extern OSStatus ISpStartup(void ) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpStartup ENDIF ; 1.1 or later ; ; extern OSStatus ISpShutdown(void ) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpShutdown ENDIF ; 1.1 or later ; ; * ; * polling ; * ; ; ; extern OSStatus ISpTickle(void ) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpTickle ENDIF ; 1.1 or later ; ********** user interface functions ********* ; ; extern NumVersion ISpGetVersion(void ) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpGetVersion ENDIF ; ; * ; * ISpElement_NewVirtual(ISpElementReference *outElement); ; * ; ; ; extern OSStatus ISpElement_NewVirtual(UInt32 dataSize, ISpElementReference *outElement, UInt32 flags) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpElement_NewVirtual ENDIF ; ; * ; * ISpElement_NewVirtualFromNeeds(UInt32 count, ISpNeeds *needs, ISpElementReference *outElements); ; * ; ; ; extern OSStatus ISpElement_NewVirtualFromNeeds(UInt32 count, ISpNeed *needs, ISpElementReference *outElements, UInt32 flags) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpElement_NewVirtualFromNeeds ENDIF ; ; * ; * ISpElement_DisposeVirtual(inElement); ; * ; ; ; extern OSStatus ISpElement_DisposeVirtual(UInt32 count, ISpElementReference *inElements) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpElement_DisposeVirtual ENDIF ; ; * ISpInit ; * ; ; ; extern OSStatus ISpInit(UInt32 count, ISpNeed *needs, ISpElementReference *inReferences, OSType appCreatorCode, OSType subCreatorCode, UInt32 flags, short setListResourceId, UInt32 reserved) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpInit ENDIF ; ; * ISpConfigure ; * ; ; ; extern OSStatus ISpConfigure(ISpEventProcPtr inEventProcPtr) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpConfigure ENDIF ; ; * ; * ISpStop ; * ; ; ; extern OSStatus ISpStop(void ) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpStop ENDIF ; ; * ; * ISpSuspend, ISpResume ; * ; * ISpSuspend turns all devices off and allocates memory so that the state may be later resumed. ; * ISpResume resumes to the previous state of the system after a suspend call. ; * ; * Return Codes ; * memFullErr ; * ; ; ; extern OSStatus ISpSuspend(void ) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpSuspend ENDIF ; ; extern OSStatus ISpResume(void ) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpResume ENDIF ; ; * ISpDevices_Extract, ISpDevices_ExtractByClass, ISpDevices_ExtractByIdentifier ; * ; * These will extract as many device references from the system wide list as will fit in your buffer. ; * ; * inBufferCount - the size of your buffer (in units of sizeof(ISpDeviceReference)) this may be zero ; * buffer - a pointer to your buffer ; * outCount - contains the number of devices in the system ; * ; * ISpDevices_ExtractByClass extracts and counts devices of the specified ISpDeviceClass ; * ISpDevices_ExtractByIdentifier extracts and counts devices of the specified ISpDeviceIdentifier ; * ; * Return Codes ; * paramErr ; * ; ; ; extern OSStatus ISpDevices_Extract(UInt32 inBufferCount, UInt32 *outCount, ISpDeviceReference *buffer) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpDevices_Extract ENDIF ; ; extern OSStatus ISpDevices_ExtractByClass(ISpDeviceClass inClass, UInt32 inBufferCount, UInt32 *outCount, ISpDeviceReference *buffer) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpDevices_ExtractByClass ENDIF ; ; extern OSStatus ISpDevices_ExtractByIdentifier(ISpDeviceIdentifier inIdentifier, UInt32 inBufferCount, UInt32 *outCount, ISpDeviceReference *buffer) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpDevices_ExtractByIdentifier ENDIF ; ; * ISpDevices_ActivateClass, ISpDevices_DeactivateClass, ISpDevices_Activate, ISpDevices_Deactivate, ISpDevice_IsActive ; * ; * ISpDevices_Activate, ISpDevices_Deactivate ; * ; * This will activate/deactivate a block of devices. ; * inDeviceCount - the number of devices to activate / deactivate ; * inDevicesToActivate/inDevicesToDeactivate - a pointer to a block of memory contains the devices references ; * ; * ISpDevices_ActivateClass, ISpDevices_DeactivateClass ; * inClass - the class of devices to activate or deactivate ; * ; * ISpDevice_IsActive ; * inDevice - the device reference that you wish to ; * outIsActive - a boolean value that is true when the device is active ; * ; * Return Codes ; * paramErr ; * ; ; ; extern OSStatus ISpDevices_ActivateClass(ISpDeviceClass inClass) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpDevices_ActivateClass ENDIF ; 1.1 or later ; ; extern OSStatus ISpDevices_DeactivateClass(ISpDeviceClass inClass) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpDevices_DeactivateClass ENDIF ; 1.1 or later ; ; extern OSStatus ISpDevices_Activate(UInt32 inDeviceCount, ISpDeviceReference *inDevicesToActivate) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpDevices_Activate ENDIF ; ; extern OSStatus ISpDevices_Deactivate(UInt32 inDeviceCount, ISpDeviceReference *inDevicesToDeactivate) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpDevices_Deactivate ENDIF ; ; extern OSStatus ISpDevice_IsActive(ISpDeviceReference inDevice, Boolean *outIsActive) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpDevice_IsActive ENDIF ; ; * ISpDevice_GetDefinition ; * ; * ; * inDevice - the device you want to get the definition for ; * inBuflen - the size of the structure (sizeof(ISpDeviceDefinition)) ; * outStruct - a pointer to where you want the structure copied ; * ; * Return Codes ; * paramErr ; * ; ; ; extern OSStatus ISpDevice_GetDefinition(ISpDeviceReference inDevice, UInt32 inBuflen, ISpDeviceDefinition *outStruct) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpDevice_GetDefinition ENDIF ; ; * ; * ISpDevice_GetElementList ; * ; * inDevice - the device whose element list you wish to get ; * outElementList - a pointer to where you want a reference to that list stored ; * ; * Return Codes ; * paramErr ; * ; ; ; extern OSStatus ISpDevice_GetElementList(ISpDeviceReference inDevice, ISpElementListReference *outElementList) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpDevice_GetElementList ENDIF ; ; * ; * takes an ISpElementReference and returns the group that it is in or 0 if there is ; * no group ; * ; * Return Codes ; * paramErr ; * ; ; ; extern OSStatus ISpElement_GetGroup(ISpElementReference inElement, UInt32 *outGroup) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpElement_GetGroup ENDIF ; ; * ; * takes an ISpElementReference and returns the device that the element belongs ; * to. ; * ; * Return Codes ; * paramErr if inElement is 0 or outDevice is nil ; * ; ; ; extern OSStatus ISpElement_GetDevice(ISpElementReference inElement, ISpDeviceReference *outDevice) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpElement_GetDevice ENDIF ; ; * ; * takes an ISpElementReference and gives the ISpElementInfo for that Element. This is the ; * the set of standard information. You get ISpElementKind specific information ; * through ISpElement_GetConfigurationInfo. ; * ; * Return Codes ; * paramErr if inElement is 0 or outInfo is nil ; * ; ; ; extern OSStatus ISpElement_GetInfo(ISpElementReference inElement, ISpElementInfoPtr outInfo) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpElement_GetInfo ENDIF ; ; * ; * ; * ; * takes an ISpElementReference and gives the ISpElementKind specific configuration information ; * ; * if buflen is not long enough to hold the information ISpElement_GetConfigurationInfo will ; * copy buflen bytes of the data into the block of memory pointed to by configInfo and ; * will return something error. ; * ; * Return Codes ; * paramErr if inElement or configInfo is nil ; * ; ; ; extern OSStatus ISpElement_GetConfigurationInfo(ISpElementReference inElement, UInt32 buflen, void *configInfo) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpElement_GetConfigurationInfo ENDIF ; ; * ; * ISpElement_GetSimpleState ; * ; * Takes an ISpElementReference and returns the current state of that element. This is a ; * specialized version of ISpElement_GetComplexState that is only appropriate for elements ; * whose data fits in a signed 32 bit integer. ; * ; * ; * ; * Return Codes ; * paramErr if inElement is 0 or state is nil ; * ; ; ; extern OSStatus ISpElement_GetSimpleState(ISpElementReference inElement, UInt32 *state) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpElement_GetSimpleState ENDIF ; ; * ; * ISpElement_GetComplexState ; * ; * Takes an ISpElementReference and returns the current state of that element. ; * Will copy up to buflen bytes of the current state of the device into ; * state. ; * ; * ; * Return Codes ; * paramErr if inElement is 0 or state is nil ; * ; ; ; extern OSStatus ISpElement_GetComplexState(ISpElementReference inElement, UInt32 buflen, void *state) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpElement_GetComplexState ENDIF ; ; * ISpElement_GetNextEvent ; * ; * It takes in an element reference and the buffer size of the ISpElementEventPtr ; * it will set wasEvent to true if there was an event and false otherwise. If there ; * was not enough space to fill in the whole event structure that event will be ; * dequed, as much of the event as will fit in the buffer will by copied and ; * ISpElement_GetNextEvent will return an error. ; * ; * Return Codes ; * paramErr ; * ; ; ; extern OSStatus ISpElement_GetNextEvent(ISpElementReference inElement, UInt32 bufSize, ISpElementEventPtr event, Boolean *wasEvent) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpElement_GetNextEvent ENDIF ; ; * ; * ISpElement_Flush ; * ; * It takes an ISpElementReference and flushes all the events on that element. All it guaruntees is ; * that any events that made it to this layer before the time of the flush call will be flushed and ; * it will not flush any events that make it to this layer after the time when the call has returned. ; * What happens to events that occur during the flush is undefined. ; * ; * ; * Return Codes ; * paramErr ; * ; ; ; extern OSStatus ISpElement_Flush(ISpElementReference inElement) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpElement_Flush ENDIF ; ; * ISpElementList_New ; * ; * Creates a new element list and returns it in outElementList. In count specifies ; * the number of element references in the list pointed to by inElements. If inCount ; * is non zero the list is created with inCount elements in at as specified by the ; * inElements parameter. Otherwise the list is created empty. ; * ; * ; * Return Codes ; * out of memory - If it failed to allocate the list because it was out of memory ; it will also set outElementList to 0 ; * paramErr if outElementList was nil ; * ; * ; * Special Concerns ; * ; * interrupt unsafe ; * ; ; ; extern OSStatus ISpElementList_New(UInt32 inCount, ISpElementReference *inElements, ISpElementListReference *outElementList, UInt32 flags) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpElementList_New ENDIF ; ; * ISpElementList_Dispose ; * ; * Deletes an already existing memory list. ; * ; * ; * Return Codes ; * paramErr if inElementList was 0 ; * ; * ; * Special Concerns ; * ; * interrupt unsafe ; * ; ; ; extern OSStatus ISpElementList_Dispose(ISpElementListReference inElementList) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpElementList_Dispose ENDIF ; ; * ISpGetGlobalElementList ; * ; * returns the global element list ; * ; * Return Codes ; * paramErr if outElementList is nil ; * ; ; ; extern OSStatus ISpGetGlobalElementList(ISpElementListReference *outElementList) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpGetGlobalElementList ENDIF ; ; * ISpElementList_AddElement ; * ; * adds an element to the element list ; * ; * Return Codes ; * paramErr if inElementList is 0 or newElement is 0 ; * memory error if the system is unable to allocate enough memory ; * ; * Special Concerns ; * interrupt Unsafe ; * ; ; ; extern OSStatus ISpElementList_AddElements(ISpElementListReference inElementList, UInt32 refCon, UInt32 count, ISpElementReference *newElements) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpElementList_AddElements ENDIF ; ; * ISpElementList_RemoveElement ; * ; * removes the specified element from the element list ; * ; * Return Codes ; * paramErr if inElementList is 0 or oldElement is 0 ; * memory error if the system is unable to allocate enough memory ; * ; * Special Concerns ; * interrupt Unsafe ; * ; ; ; extern OSStatus ISpElementList_RemoveElements(ISpElementListReference inElementList, UInt32 count, ISpElementReference *oldElement) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpElementList_RemoveElements ENDIF ; ; * ISpElementList_Extract ; * ; * ISpElementList_Extract will extract as many of the elements from an element list as possible. You pass ; * in an element list, a pointer to an array of element references and the number of elements in that array. ; * It will return how many items are in the element list in the outCount parameter and copy the minimum of ; * that number and the size of the array into the buffer. ; * ; * ByKind and ByLabel are the same except that they will only count and copy element references to elements ; * that have the specified kind and label. ; * ; * Return Codes ; * paramErr ; * ; ; ; extern OSStatus ISpElementList_Extract(ISpElementListReference inElementList, UInt32 inBufferCount, UInt32 *outCount, ISpElementReference *buffer) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpElementList_Extract ENDIF ; ; extern OSStatus ISpElementList_ExtractByKind(ISpElementListReference inElementList, ISpElementKind inKind, UInt32 inBufferCount, UInt32 *outCount, ISpElementReference *buffer) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpElementList_ExtractByKind ENDIF ; ; extern OSStatus ISpElementList_ExtractByLabel(ISpElementListReference inElementList, ISpElementLabel inLabel, UInt32 inBufferCount, UInt32 *outCount, ISpElementReference *buffer) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpElementList_ExtractByLabel ENDIF ; ; * ISpElementList_GetNextEvent ; * ; * It takes in an element list reference and the buffer size of the ISpElementEventPtr ; * it will set wasEvent to true if there was an event and false otherwise. If there ; * was not enough space to fill in the whole event structure that event will be ; * dequed, as much of the event as will fit in the buffer will by copied and ; * ISpElementList_GetNextEvent will return an error. ; * ; * Return Codes ; * paramErr ; * ; ; ; extern OSStatus ISpElementList_GetNextEvent(ISpElementListReference inElementList, UInt32 bufSize, ISpElementEventPtr event, Boolean *wasEvent) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpElementList_GetNextEvent ENDIF ; ; * ; * ISpElementList_Flush ; * ; * It takes an ISpElementListReference and flushes all the events on that list. All it guaruntees is ; * that any events that made it to this layer before the time of the flush call will be flushed and ; * it will not flush any events that make it to this layer after the time when the call has returned. ; * What happens to events that occur during the flush is undefined. ; * ; * ; * Return Codes ; * paramErr ; * ; ; ; extern OSStatus ISpElementList_Flush(ISpElementListReference inElementList) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpElementList_Flush ENDIF ; ; * ; * ISpTimeToMicroseconds ; * ; * ; * This function takes time from an input sprocket event and converts it ; * into microseconds. (Version 1.2 or later of InputSprocket.) ; * ; * ; * Return Codes ; * paramErr ; * ; ; ; extern OSStatus ISpTimeToMicroseconds(const AbsoluteTime *inTime, UnsignedWide *outMicroseconds) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ISpTimeToMicroseconds ENDIF ENDIF ; TARGET_RT_MAC_CFM ENDIF ; __INPUTSPROCKET__